import api from '@/services/api';

// 获取全部已审批借用记录（DTO，含教师姓名等）
export async function getAllReviewedBookings() {
  return api.get('/api/classroom-booking/list');
}

// 按教师姓名查
export async function getBookingsByTeacherName(teacherName) {
  return api.get('/api/classroom-booking/by-teacher', { params: { teacherName } });
}

// 按教室编号查
export async function getBookingsByRoomNumber(roomNumber) {
  return api.get('/api/classroom-booking/by-classroom', { params: { roomNumber } });
}

// 审批
export async function reviewClassroomApplication({ bookingId, status, reviewerId, remark = '' }) {
  return api.put('/api/classroom-booking/review', null, {
    params: { bookingId, status, reviewerId, remark }
  });
}
